package com.wuxiaoqin.admin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wuxiaoqin.admin.entity.Address;
import com.wuxiaoqin.admin.mapper.AddressMapper;
import com.wuxiaoqin.admin.service.IAddressService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author jobob
 * @since 2021-11-02
 */
@Service
public class AddressServiceImpl extends ServiceImpl<AddressMapper, Address> implements IAddressService {

    @Autowired
    private AddressMapper addressMapper;
    @Override
    public Page<Address> getAllAddress(Integer pageSize, Integer pageNo) {
        Page<Address> addressPage = new Page<>(pageNo,pageSize);
        Page<Address> addressPage1 = addressMapper.selectPage(addressPage, new QueryWrapper<Address>().select("*"));
        return addressPage1;
    }
}
